package androidx.viewpager.widget;

import android.os.Bundle;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import o.hc;
import o.in;

class ViewPager$b extends hc {
    final /* synthetic */ ViewPager ˊ;

    ViewPager$b(ViewPager viewPager) {
        this.ˊ = viewPager;
    }

    public void ˎ(View view, AccessibilityEvent accessibilityEvent) {
        super.ˎ(view, accessibilityEvent);
        accessibilityEvent.setClassName(ViewPager.class.getName());
        accessibilityEvent.setScrollable(ˎ());
        if (accessibilityEvent.getEventType() == 4096 && this.ˊ.mAdapter != null) {
            accessibilityEvent.setItemCount(this.ˊ.mAdapter.getCount());
            accessibilityEvent.setFromIndex(this.ˊ.mCurItem);
            accessibilityEvent.setToIndex(this.ˊ.mCurItem);
        }
    }

    public void ˋ(View view, in inVar) {
        super.ˋ(view, inVar);
        inVar.ˏ(ViewPager.class.getName());
        inVar.ˏॱ(ˎ());
        if (this.ˊ.canScrollHorizontally(1)) {
            inVar.ˊ(4096);
        }
        if (this.ˊ.canScrollHorizontally(-1)) {
            inVar.ˊ(8192);
        }
    }

    public boolean ˊ(View view, int i, Bundle bundle) {
        if (super.ˊ(view, i, bundle)) {
            return true;
        }
        switch (i) {
            case 4096:
                if (!this.ˊ.canScrollHorizontally(1)) {
                    return false;
                }
                this.ˊ.setCurrentItem(this.ˊ.mCurItem + 1);
                return true;
            case 8192:
                if (!this.ˊ.canScrollHorizontally(-1)) {
                    return false;
                }
                this.ˊ.setCurrentItem(this.ˊ.mCurItem - 1);
                return true;
            default:
                return false;
        }
    }

    private boolean ˎ() {
        return this.ˊ.mAdapter != null && this.ˊ.mAdapter.getCount() > 1;
    }
}
